//
//  DetailTableViewCell.m
//  CatMusic
//
//  Created by dllo on 15/4/24.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "DetailTableViewCell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation DetailTableViewCell
- (void)dealloc
{
    [_singerLabel release];
    [_songNameLabel release];
    [_numberLabel release];
    [_cellBackImage release];
    [_myButton release];
    [super dealloc];
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.cellBackImage = [[UIImageView alloc] init];
        [self.contentView addSubview:self.cellBackImage];
        [self.cellBackImage release];
        
        
        self.numberLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.numberLabel];
        [self.numberLabel release];
        
        
        self.songNameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.songNameLabel];
        [self.songNameLabel release];
        
        
        self.singerLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.singerLabel];
        [self.singerLabel release];
        
        self.myButton = [UIButton buttonWithType:UIButtonTypeSystem];
//        [self.myButton setBackgroundImage:[UIImage imageNamed:@"iconfont-add"] forState:UIControlStateNormal];
        [self.myButton setImage:[UIImage imageNamed:@"iconfont-xiangyou"] forState:UIControlStateNormal];
        [self.contentView addSubview:self.myButton];
        self.rseult = NO;
        
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    
    
    [self.cellBackImage setFrame:CGRectMake(WIDTH /375 * 10, HEIGHT / 60 * 5, WIDTH - 20, HEIGHT - 10)];
    [self.cellBackImage setImage:[UIImage imageNamed:@"cellBack"]];
    self.cellBackImage.layer.cornerRadius = 10;
//    self.cellBackImage.layer.borderWidth = 1;
    self.cellBackImage.clipsToBounds = YES;


    
    
    
    
    [self.numberLabel setFrame:CGRectMake(WIDTH /375 * 30, HEIGHT / 60 * 20, WIDTH / 375 * 100, HEIGHT / 60 * 20)];

    [self.songNameLabel setFrame:CGRectMake(WIDTH / 375 * 80, HEIGHT / 60 * 8, WIDTH - 10 - WIDTH / 375 * 80, HEIGHT / 60 * 20)];

    
//    [self.songNameLabel setFrame:CGRectMake(WIDTH / 375 * 80, HEIGHT / 60 * 10, WIDTH / 375 * 300, HEIGHT / 60 * 20)];
    
    [self.singerLabel setFrame:CGRectMake(WIDTH / 375 * 80, HEIGHT / 60 * 32, WIDTH / 375 * 300, HEIGHT / 60 * 20)];
    

    [self.myButton setFrame:CGRectMake(WIDTH / 375 * 330, HEIGHT / 60 * 18, WIDTH / 375 * 30, HEIGHT / 60* 30)];

    
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
